/**
 * CustomerService 业务逻辑实现类
 * @author yanwl
 * @date 2014-08-20
 */
package com.chnbst.bstyun.service.impl;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.chnbst.bstyun.core.base.BaseService;
import com.chnbst.bstyun.core.common.helper.DaoHelper;
import com.chnbst.bstyun.model.pojo.CustomerService;
import com.chnbst.bstyun.service.CustomerServiceService;

@Transactional
@Service
public class CustomerServiceServiceImpl extends BaseService implements CustomerServiceService {
	
	//声明日志对象 logback
	private final static Logger logger = LoggerFactory.getLogger(CustomerServiceServiceImpl.class);
	private final static String nameSpace = "com.chnbst.bstyun.mapper.CustomerServiceMapper";
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean deleteCustomerService(Integer customerServiceId) {
		return DaoHelper.delete(nameSpace, "deleteCustomerService", customerServiceId);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean insertCustomerService(CustomerService customerService) {
		return DaoHelper.insert(nameSpace, "insertCustomerService", customerService);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean updateCustomerService(CustomerService customerService) {
		return DaoHelper.update(nameSpace, "updateCustomerService", customerService);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public CustomerService selectCustomerServiceByCustomerServiceId(Integer customerServiceId) {
		return (CustomerService)DaoHelper.query(nameSpace, "selectCustomerServiceByCustomerServiceId", customerServiceId);
	}
	
	@SuppressWarnings("unchecked")
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public List<CustomerService> selectCustomerServices(Map<String, Object> map) {
		return (List<CustomerService>)DaoHelper.list(nameSpace, "selectCustomerServices", map);
	}
}
